<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Floating Label Input</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-color: #f0f0f0;
        }

        .form-group {
            position: relative;
            margin-bottom: 25px;
            width: 300px;
        }

        .form-control {
            width: 100%;
            padding: 10px;
            font-size: 16px;
            border: 1px solid #ccc;
            border-radius: 4px;
            transition: border-color 0.3s, box-shadow 0.3s;
        }

        .form-control:focus {
            outline: none;
            border-color: #007bff;
            box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
        }

        .form-control:focus + .floating-label,
        .form-control:not(:placeholder-shown) + .floating-label {
            font-size: 12px;
            transform: translateY(-20px);
            color: #007bff;
        }

        .floating-label {
            position: absolute;
            left: 10px;
            top: 20px;
            font-size: 16px;
            color: #999;
            transition: transform 0.3s, font-size 0.3s, color 0.3s;
            pointer-events: none;
        }

        /* Optional styling for placeholder */
        .form-control::placeholder {
            color: transparent; /* Hide the default placeholder text */
        }
    </style>
</head>
<body>
    <div class="form-group">
        <input type="text" id="username" class="form-control" placeholder="111 ">
        <label for="username" class="floating-label">Username</label>
    </div>

    <div class="form-group">
        <input type="password" id="password" class="form-control" placeholder=" ">
        <label for="password" class="floating-label">Password</label>
    </div>
</body>
</html>
